/*
 * Copyright (c) 2016- 2020 qolome.com Inc. All Rights Reserved.
 * ProjectName: qolome-knowledge
 * FileName: AbstractCourse.java
 * Author: jiangfeng@qolome.com
 * Date: 2020/3/13 下午6:58
 * LastModified: 2020/03/13 18:58:13
 */

package com.qolome.knowledge.design.pattern.template.demo.course;

import lombok.extern.slf4j.Slf4j;

/**
 * @author Qolome
 * @version V1.0
 * @Description 抽象课程
 * @date 2020年 03月13日 18:58:55
 */
@Slf4j
public abstract class AbstractCourse {

    protected  final void createCourse(){
        //1 发布预习资料
        postPreResource();
        // 2 .制作课件
        createPPT();
        // 3.直播授课
        liveVideo();
        // 4.上传课后资料
        postStudySource();

        // 5. 发布作业
        postHomeWork();

        if (needCheckHomework()){
            checkHomework();
        }
    }

    protected abstract void checkHomework();

    private void postHomeWork() {

        log.info("布置作业");
    }

    protected  void postStudySource(){
        log.info("上传课后资料");
    }

    protected  void liveVideo(){
        log.info("直播授课");
    }

    protected  void createPPT(){
        log.info("上传课件");
    }

    protected  void postPreResource(){
        log.info("发布预习资料");
    }


    protected boolean needCheckHomework(){
        return false;
    }

}
